package edu.zut.hb.software.hospital.service.impl;

import edu.zut.hb.software.admin.domain.User;
import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.hospital.dao.DepartmentDao;
import edu.zut.hb.software.hospital.domain.Department;
import edu.zut.hb.software.hospital.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.List;


@Service
@Transactional
public class DepartmentServiceImpl extends GenericManagerImpl<Department,Long> implements DepartmentService {

    DepartmentDao departmentDao;

    @Autowired
    public void setDepartmentDao(DepartmentDao departmentDao) {
        this.departmentDao = departmentDao;
        this.dao=this.departmentDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Department department = new Department();
            department.setName("第"+i+"诊室");
            department.setNum(i);
            department.setStatus(true);
            list.add(department);
        }
        return list;
    }
}
